package elsa.controller;

import org.apache.catalina.connector.ClientAbortException;
import org.apache.shiro.authz.UnauthenticatedException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@ControllerAdvice
public class HandlerController {

    @ExceptionHandler(UnauthenticatedException.class)
    public void handlerUnauthenticatedException(UnauthenticatedException e){
        e.printStackTrace();
        System.out.println("捕获异常UnauthenticatedException");
    }

    @ExceptionHandler(ClientAbortException.class)
    public void handlerClientAbortException(ClientAbortException e){
        e.printStackTrace();
        System.out.println("捕获异常ClientAbortException");
    }

    @ExceptionHandler(IllegalArgumentException.class)
    public void handlerIllegalArgumentException(IllegalArgumentException e){
        e.printStackTrace();
        System.out.println("捕获异常IllegalArgumentException");
    }
}
